package com.bestcem.xm.common.core.constant;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * 资源错误码 仿照python
 * app/errors.py/AppResourceError
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/8/4
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class AppResourceErrorCode {

    public static final Integer CODE_MIN = 200;

    /**
     * 资源不存在
     */
    public static final Integer NOT_FOUND = CODE_MIN + 1;

    /**
     * 请求过于频繁
     */
    public static final Integer TOO_BUSY = CODE_MIN + 2;

    /**
     * 重复操做相同资源
     */
    public static final Integer DUPLICATE = CODE_MIN + 4;

    /**
     * 没有权限
     */
    public static final Integer PERMISSION_DENY = CODE_MIN + 7;


    /**
     * 请求过于频繁
     */
    public static final Integer FORBIDDEN = CODE_MIN + 9;

    /**
     * 第三方资源申请失败
     */
    public static final Integer THIRDPART = CODE_MIN + 11;

    /**
     * 资源已存在
     */
    public static final Integer FOUND = CODE_MIN + 18;

    /**
     * 资源数量过多
     */
    public static final Integer TOO_MUCH = CODE_MIN + 20;

    /**
     * 当前task正在执行
     */
    public static final Integer TASK_WORKING = CODE_MIN + 25;

    /**
     * 达到资源限额
     */
    public static final Integer QUOTA_REACHED = CODE_MIN + 31;
}
